package YZ.Students.Mier.controller.web;

import YZ.Students.Mier.Service.IInvitataionService;
import YZ.Students.Mier.Service.impl.InvitataionServiceImpl;
import YZ.Students.Mier.controller.BaseServlet;
import YZ.Students.Mier.vo.IndexDataVo;

import javax.servlet.annotation.WebServlet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @className: IndexServlet
 * @author: shuishui
 * @date: 2022/12/05 17:45
 */
@WebServlet("/IndexServlet/*")
public class IndexServlet extends BaseServlet {
    private IInvitataionService invitataionService = new InvitataionServiceImpl();
    public void index() throws Exception{
        List<IndexDataVo> list = invitataionService.indexDataList();
        // 2.放到Map中
        Map<String, Object> map = new HashMap<>();
        map.put("indexDataVoList", list);

        // 3.跳转到视图
        outView("view/index", map);
    }
}
